using MediatR;
using Microsoft.AspNetCore.Mvc;
using PersonalWebsite.Application.Queries.Post;
using PersonalWebsite.Application.Queries.Website;
using PersonalWebsite.Core.Result;

namespace PersonalWebsite.Shell.Controllers
{
    public class WebsiteController : BaseController
    {
        private readonly ILogger<WebsiteController> _logger;
        private readonly IMediator mediator;

        public WebsiteController(ILogger<WebsiteController> logger,IMediator mediator)
        {
            _logger = logger;
            this.mediator = mediator;
        }

        [HttpGet("info")]
        public async Task<ApiResult<GetAdminInfoVO>> GetAdminInfo()
        {
            return await mediator.Send(new GetAdminInfoQuery());
        }

        [HttpGet("abilities")]
        public async Task<ApiResult<List<GetAbilityVO>>> GetAbilities() 
        {
            return await mediator.Send(new GetAbilityQuery());
        }

        [HttpGet("pro-experiences")]
        public async Task<ApiResult<List<GetAdminProExperienceVO>>> GetAdminProExperience()
        {
            return await mediator.Send(new GetAdminProExperienceQuery());
        }

        [HttpGet("web-info")]
        public async Task<ApiResult<GetWebsiteInfoVO>> GetWebsiteInfo()
        {
            return await mediator.Send(new GetWebsiteInfoQuery());
        }

        [HttpGet("post-categories")]
        public async Task<ApiResult<List<GetPostCategoryVO>>> GetPostCategories()
        {
            return await mediator.Send(new GetPostCategoryQuery());
        }

        [HttpPost("postes")]
        public async Task<ApiResult<List<GetPostVO>>> GetPostes(GetPostQuery query)
        {
            return await mediator.Send(query);
        }

        [HttpGet("game-videos")]
        public async Task<ApiResult<List<GetGameVideoVO>>> GetGameVideoes()
        {
            return await mediator.Send(new GetGameVideoQuery());
        }

        [HttpGet("tga-games")]
        public async Task<ApiResult<List<GetTgaGameVO>>> GetTgaGames()
        {
            return await mediator.Send(new GetTgaGameQuery());
        }

        [HttpGet("shows")]
        public async Task<ApiResult<List<GetShowVO>>> GetShows()
        {
            return await mediator.Send(new GetShowVOQuery());
        }

        [HttpGet("books")]
        public async Task<ApiResult<List<GetBookVO>>> GetBooks()
        {
            return await mediator.Send(new GetBookQuery());
        }

        [HttpGet("hot-movies")]
        public async Task<ApiResult<List<GetHotMovieVO>>> GetHotMovies()
        {
            return await mediator.Send(new GetHotMovieQuery());
        }

        [HttpGet("category-projects")]
        public async Task<ApiResult<List<GetCategoryProjectVO>>> GetCategoryProjects()
        {
            return await mediator.Send(new GetCategoryProjectVOQuery());
        }
    }
}
